package com.rayc.mall.api.client;

import com.rayc.mall.api.dto.OrderDTO;
import com.rayc.mall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: Ray-C
 * @CreateTime: 2025-03-25
 * @Description: order远程调用client
 * @Version: 1.0
 */
@FeignClient("mall-order")
public interface OrderClient {
    @GetMapping("/orders/listByUserId")
    Result<List<OrderDTO>> queryByUserId(@RequestParam Long userId);

    @GetMapping("/orders")
    Result<OrderDTO> queryById(@RequestParam Long id);

    @PutMapping("/orders/success/{id}")
    Result<String> markOrderPaySuccess(@PathVariable("id") Long orderId);

    @PutMapping("/orders/cancel/{id}")
    Result<String> cancelOrder(@PathVariable("id") Long orderId);
}
